# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1Replay do
  @moduledoc """
  A resource describing a `Replay`, or simulation.

  ## Attributes

  *   `config` (*type:* `GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1ReplayConfig.t`, *default:* `nil`) - Required. The configuration used for the `Replay`.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. The resource name of the `Replay`, which has the following format: `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}`, where `{resource-id}` is the ID of the project, folder, or organization that owns the Replay. Example: `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36`
  *   `resultsSummary` (*type:* `GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1ReplayResultsSummary.t`, *default:* `nil`) - Output only. Summary statistics about the replayed log entries.
  *   `state` (*type:* `String.t`, *default:* `nil`) - Output only. The current state of the `Replay`.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :config =>
            GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1ReplayConfig.t() | nil,
          :name => String.t() | nil,
          :resultsSummary =>
            GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1ReplayResultsSummary.t()
            | nil,
          :state => String.t() | nil
        }

  field(:config, as: GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1ReplayConfig)
  field(:name)

  field(:resultsSummary,
    as: GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1ReplayResultsSummary
  )

  field(:state)
end

defimpl Poison.Decoder, for: GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1Replay do
  def decode(value, options) do
    GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1Replay.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1Replay do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
